<template>
  <div class="crumb">
    <i v-if="SHOW_ICON" style="margin-right:5px" :class="node.isDir ? 'fa fa-folder-o' : 'fa fa-file-o'"></i>
    <div :class="fileClassName">{{ node.name }}</div>
  </div>
</template>

<script>
  export default {
    name: 'MyCrumb',
    data: function () {
      return {
        SHOW_ICON: true
      }
    },
    computed: {
      fileClassName: function () {
        let fileClassName = 'crumb-node-name'
        if (!this.node.isDir) {
          fileClassName = `crumb-node-name git-${ this.node.gitStatus ? this.node.gitStatus.toLowerCase() : 'none' }`
        }
        return fileClassName
      }
    },
    props: {
      node: {
        default: {}
      }
    }
  }

</script>
